package com.itzhigui.goods.controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author java1412
 * @since 2023-10-30 11:17:48
 */
@RestController
@RequestMapping(value = "/api/v1/config")
@RefreshScope   // 刷新的作用域，nacos中的配置后立即同步
public class ConfigTestController {

    @Value("${user.userName}")
    private String userName;

    @RequestMapping(value = "/test-config")
    public String findByGoodsId() {
        return userName;
    }
}
